using System;
using System.Collections.Generic;
using System.Text;

namespace Acms.AcmsControls
{
    [Serializable]
    public class TextContentControlProperties : BaseContentControlProperties
    {
        private string text;
        public string Text
        {
            get { return text; }
            set { text = value; }
        }

        protected override void ReadValue(System.Xml.XmlReader reader)
        {
            if (reader.Name.ToLower() == "text" && (reader.NodeType == System.Xml.XmlNodeType.Element || reader.NodeType == System.Xml.XmlNodeType.Attribute))
            {
                if (reader.NodeType == System.Xml.XmlNodeType.Element)
                {
                    reader.Read();
                }
                try
                {
                    text = reader.ReadContentAsString();
                }
                catch
                {
                }
            }
        }

        protected override void WriterPropertiesToXml(System.Xml.XmlWriter writer)
        {

            writer.WriteStartElement("content");

            writer.WriteStartElement("text");
            writer.WriteValue(this.Text);
            writer.WriteEndElement();

            writer.WriteEndElement();
        }

    }
}
